import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import pric.cwr.excel.utils.ExcelUtils;
import pric.cwr.excel.vo.UserVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: TODO
 * @author: chenwenrui
 * @date: 2023/11/2 16:50
 */
public class ExcelMain {

    public static String FILE_NAME = "/Users/very/Desktop/用户信息.xlsx";
    public static String SHEET_NAME = "用户信息";

    public static void main(String[] args) {
        create();
    }

    public static void create() {
        List<UserVO> userVOList = new ArrayList<>();
        userVOList.add(new UserVO(1001L, "张三"));
        userVOList.add(new UserVO(1002L, "李四"));
        userVOList.add(new UserVO(1003L, "王五"));
        // 导出excel到本地文件
        ExcelUtils.exportLocal(FILE_NAME, SHEET_NAME, userVOList, UserVO.class);
    }
}
